import java.io.*;

public class SAVERESOURCE {
    public static void SaveResource() throws IOException {
        OutputStream os = new FileOutputStream("D:\\临时文件夹1\\java-study\\untitled1\\src\\resouce\\resouce.txt");
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(os));
        try (FileWriter writer = new FileWriter("D:\\临时文件夹1\\java-study\\untitled1\\src\\resouce\\resouce.txt", false)) {
        }catch (IOException e) {
            e.printStackTrace();
        }
       try {String string=new String("");
           for (Staff staff:Main.staffList) {
               string=string+staff.getName()+"!";
               string=string+staff.getGender()+"!";
               string=string+staff.getAge()+"!";
               string=string+staff.getTime()+"!";
               string=string+staff.getAddress()+"!";
               string=string+staff.getPhonenum()+"!";
               string=string+staff.getSalary()+"!";
               string=string+staff.getPosition()+"!"+")";
           }
           bw.write(string);
       }finally {
           bw.close();
           os.close();
       }
    }
    public static void main(String[] args) throws IOException {
        SaveResource();
    }
}
